package com.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.model.auto.SchoolIntroduction;
import com.service.ISchoolIntroductionService;
import com.util.R;
import com.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 学校介绍
 * @author astupidcoder
 * @since 2022-09-14
 */
@RestController
@RequestMapping("/SchoolIntroduction")
public class SchoolIntroductionController{
    @Autowired
    private ISchoolIntroductionService schoolIntroductionService;

    /**
     * 获取学校介绍
     * @param code
     * @return
     */
    @GetMapping("/getSchoolIntroduction")
    public R getSchoolIntroduction(String code, String schoolName) {
        SchoolIntroduction schoolIntroduction = schoolIntroductionService.selectOneBySchoolCode(code, schoolName);
        return R.ok(schoolIntroduction);
    }

    /**
     * 获取学校详细信息
     * @param code
     * @return
     */
    @GetMapping("/getSchoolDetail")
    public R getSchoolDetail(String code, String schoolName) {
        SchoolIntroduction schoolIntroduction = schoolIntroductionService.selectByCode(code, schoolName);
        return R.ok(schoolIntroduction);
    }

    /**
     * 获取学校详细信息V2
     * @param code
     * @return
     */
    @GetMapping("/getSchoolDetailV2")
    public R getSchoolDetailV2(String code, String schoolName) {
        SchoolIntroduction schoolIntroduction = schoolIntroductionService.selectByCodeV2(code, schoolName);
        return R.ok(schoolIntroduction);
    }
}
